summaryrefslogtreecommitdiff
path: root/roms/programs/Random Number Test [Matthew Mikolay, 2010].txt
blob: 7a18661a225df2abe2830aebd0d9ce12c562f7ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Hey guys!

I don't know if any of you will be interested in this, but I wrote this small
program while coding my game to test out the random number generator. I wanted
to see if there is a chance that zero will show up as the random number, and it
turns out it can.

Anyway, when you run the program, it brings a random number up on the screen.
When you press any of the keys, it brings another random number up on the
screen. This goes on until you quit the program.

Address 0x202 holds the C0FF instruction, which commands the CHIP-8 interpreter
to set V0 to a random number with the mask 0xFF. This yields 256 different
possible numbers (0-255). If C0FF is changed to something like C00A, then the
mask will change. This would yield 11 different possible numbers (0-10).

-Matt